#ifndef FND_GAME_SHADER_LIGHT_SYSTEM_H
#define FND_GAME_SHADER_LIGHT_SYSTEM_H
#include <vector>
#include <boost/noncopyable.hpp>
#include "ltbasedefs.h"
#include "shader_light.h"
#include <string>
class LTEffectShader ;

class shader_light_system : boost::noncopyable {
private:
    typedef std::vector<shader_light> shader_type_vec_type ;
public:
    typedef shader_type_vec_type::value_type value_type ;
private:
    shader_type_vec_type m_lights ;
    float m_ambient[4] ;
private:
    void set_info(float* address, const float* data, int num) ;
public:
    void read_lights_page(const std::string& page_name) ;
    void set_light_position(int id, const float* position) ;
    void set_light_color(int id, const float* color) ;
    void set_light_constane_attenuation(int id, float ca) ;
    void set_light_linear_attenuation(int id, float la) ;
    void set_light_quadratic_attenuation(int id, float qa) ;
    void set_ambient(const float* ambient) ;
    void use_lights(LTEffectShader* pEffect, float factor, const float* pos,
                    float radius, int max_lights) ;
    void clear_lights() { m_lights.clear() ;}
    void add_light(const shader_light& l) {m_lights.push_back(l) ;}
    void range_light_by_distance(const LTVector& pos) ;
    void set_light(size_t id, const shader_light& l) {m_lights[id] = l;}
    shader_light_system() ;
} ;
#endif
